﻿//ttlang 核心库定义恩济，这个文件用utf8编码
//这是一个资源文件，会嵌入项目中
class Console
{
	extern Log(txt:string):string
	extern Warn(txt:string):string
	extern Error(txt:string):string
}

//入口点,注解，注解是一个函数还是一个构造函数，是一个问题
extern function EntryPoint():void

namespace Math
{
	extern function Pow(v1:float64,v2:float64):float64;
}

namespace Time
{
	extern function NowUnixTime():uint32;//返回当前的unix时间戳
	extern function ToStringLocal(unixtime:uint32):string;
	extern function ToStringUTC(unixtime:uint32):string;
	extern function ParseLocal(time:string):uint32; //从字符串解析unixtime
	extern function ParseUTC(unixtime:int32):string;
}

namespace System
{
	//sleep 单位 毫秒
	extern function Sleep(time:int32):void;
}

class StopWatch
{
	extern Reset():void;
	extern GetElapsed():void;
	extern GetElapsedAndReset():void;
}

//Spec PRIMITIVE
//string 是很特殊的
primitive class string
{
	extern Clear():void;
	extern ToString():string;
}
primitive struct void
{

}
//PRIMITIVE
primitive struct int8
{
	extern ToString():string;
}
primitive struct uint8
{
	extern ToString():string;
}
primitive struct int16
{
	extern ToString():string;
}
primitive struct uint16
{
	extern ToString():string;
}
primitive struct int32
{
	extern ToString():string;
}
primitive struct uint32
{
	extern ToString():string;
}
primitive struct float
{
	extern ToString():string;
}
primitive struct float64
{
	extern ToString():string;
}
primitive struct bool
{
	extern ToString():string;
}